<template>
  <van-nav-bar
      title="助农端"
      left-arrow
      @click-left="onClickLeft"
      @click-right="onClickRight"
  >
    <template #right>
      <van-icon name="search" size="18"/>
    </template>
  </van-nav-bar>
  <div id="content">
    <router-view/>
  </div>
  <van-tabbar route @change="onChange">
    <van-tabbar-item to="/" icon="home-o" name="index">商品展示页</van-tabbar-item>
    <van-tabbar-item to="/activity" icon="friends-o" name="me">创意广场</van-tabbar-item>
    <van-tabbar-item to="/addGoods" icon="guide-o" name="me">添加农产品</van-tabbar-item>
  </van-tabbar>
</template>
<!--语法糖-->
<script setup>
import 'vant/es/toast/style'
import {useRouter} from "vue-router";
const router = useRouter()
const onClickLeft = () => {
  //back就是回到刚刚来的页面
  router.back()
}
const onClickRight = () => {
  router.push('/search')
}
</script>
<style scoped>
</style>